package com.coderman.common.starter.nacos.datajson.service.impl;

import com.alibaba.nacos.api.exception.NacosException;
import com.coderman.common.starter.nacos.datajson.service.DataJsonHelper;
import com.coderman.common.starter.nacos.datajson.service.DataJsonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description:
 * date: 2020/9/28 6:36 下午
 *
 * @author fanchunshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class DataJsonServiceImpl implements DataJsonService {
    @Autowired
    private DataJsonHelper dataJsonHelper;

    private static  ExpressionParser expressionParser = new SpelExpressionParser();

    @Override
    public List getDataConfigList(Class clazz) {
        return dataJsonHelper.getByClassName(clazz.getSimpleName());
    }

    @Override
    public Object getByQueryKey(Object o) {
        return dataJsonHelper.getByQuery(o);
    }
}
